﻿using AutoMapper;
using MDT.LifeSewagePlatform.Conmmon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MDT.LifeSewagePlatform.Entity
{
    public class ConfigAutoMap:Profile
    {
        public ConfigAutoMap()
        {
            #region User
            CreateMap<AddUser, UserEntity>();
            CreateMap<UpdateUser, UserEntity>();

            CreateMap<UserView, CurrentUserInfo>().
                ForMember(info=>info.UserID,(map)=>map.MapFrom(user=>user.ID));
            #endregion

            #region PlaceDuty
            CreateMap<AddPlaceDuty, PlaceDutyEntity>();
            CreateMap<UpdatePlaceDuty, PlaceDutyEntity>();
            #endregion

            #region File
            CreateMap<AddFile, FileEntity>();
            CreateMap<UpdateFile, FileEntity>();
            #endregion

            #region Drug
            CreateMap<AddDrug, DrugEntity>();
            #endregion

            #region DrugDetail
            CreateMap<AddDrugDetail, DrugDetailEntity>();
            #endregion

            #region setAlarm
            CreateMap<UpdateSetAlarm, SetAlarmEntity>();
            #endregion

            #region Company

            CreateMap<AddCompany, CompanyEntity>();

            CreateMap<UpdateCompany, CompanyEntity>();
            #endregion

            #region DrugDay
            CreateMap<AddDrugDayDto, DrugDayEntity>();
            #endregion

            #region detail
            CreateMap<AddArea, DetailEntity>();
            #endregion

            #region region
            CreateMap<RegionCreateOrUpdateDto, RegionEntity>();
            //CreateMap<RegionCreateOrUpdateDto,RegionEntity>();
            #endregion


            #region ip
            CreateMap<IpAddressDto, IpAddressEntity>();
            #endregion

            #region alaramrule
            CreateMap<AlaramRuleCreateDto,AlaramRuleEntity>();
            #endregion
        }
    }
}
